<?php
// vim:set expandtab tabstop=3 shiftwidth=3 softtabstop=3 foldclose=all foldmethod=marker:
/**
 * 项目：   5anet
 * 文件：   class/album/ShowUser.class.php
 *
 * 显示用户的相册
 *
 * PHP Version 5
 *
 * @package:   class.album
 * @author:    Mike.G Chinese Name: 黄叶 <hylinux@gmail.com>
 * @license:   http://www.gnu.org/copyleft/lesser.html  LGPL License 2.1 
 * @copyright: www.5anet.com
 * @version:   $Id: $
 * @date:      $Date: $
 */

include_once CLASS_PATH.'main/BaseAction.class.php';

//包含相册的工具表
include_once CLASS_PATH.'album/AlbumUtil.class.php';
include_once CLASS_PATH.'user/UserUtil.class.php';




class ShowUser extends BaseAction {
   /**
    * 数据库的连接
    */
   private $db;


   /**
    * 构造函数
    * @param:  NULL
    * @return: NULL
    * @access: public
    */
   public function __construct() {
      $this->db = $this->getDB();
   }


   /**
    * 显示用户的相册集
    * @param:  NULL
    * @return: NULL
    * @access: public
    */
   public function run() {
      //取得用户的id
      $id = $this->getParameterFromGET('id');
      
      //取得用户的昵称
      $album_user_name = UserUtil::getUserNameById($this->db, $id);

      //取得用户的相册目录
      $dir_info = AlbumUtil::getUserDir($this->db, $id);


      $smarty = $this->getSmarty();

      $smarty->assign('album_user_name', $album_user_name);
      $smarty->assign('user_id', $id);

      $smarty->assign('dir', $dir_info);


      //为了SEO
      $smarty->assign('clone_title', $album_user_name.'的相册/5anet.com' );
      $smarty->assign('header_meta_content', $album_user_name.'的相册/5anet.com' );


      $smarty->display('useralbum.tmpl');

 

   }
}


?>
